<template>
	<section class="user-list">
		<CommonTable :table-config="userClass.getTableConfig()">
			<template #header>
				<CommonSearch :form-data="userClass.getSearchCol()" @search="val => userClass.serach(val)" />
			</template>
			<template #search>
				<el-button type="primary" :icon="Plus" @click="userClass.add()">新增</el-button>
			</template>
		</CommonTable>
		<!-- 封面 -->
		<CommonDialog width="400" title="查看" v-model="userClass.visible.value">
			<template #default>
				<PreviewImg :url="userClass.src.value" />
			</template>
		</CommonDialog>
		<!-- 新增用户 -->
		<CommonDialog width="400" title="新增" v-model="userClass.userVisible.value" :option-btns="userClass.getBtns()">
			<template #default>
				<CommonForm ref="commonForm" :form-data="userClass.getFormCol()" :default-value="{}" />
			</template>
		</CommonDialog>
	</section>
</template>
<script lang="ts" setup>
import { Plus } from '@element-plus/icons-vue'

import { ref } from 'vue'
import { UserClass } from './controller'
import PreviewImg from '@/view/article-manage/article-list/preview-img/index.vue'
const commonForm = ref()
let userClass = new UserClass(commonForm)
</script>
